<template>
  <a-modal
    :title="title"
    :width="800"
    :visible="modalMisible"
    :plain="true"
    :rules="rules"
    :data="beGoodAt"
    v-model="show"
    @ok="submitOk"
    @cancel="modalMisible=false"
  >
    <a-form :form="form">
        <a-form-item>
          <div >
            <slot name="item" :text="item.label" v-for="item in beGoodAt" style="font-size: 20px;color: #4D90FE">  {{  item.label }} :
              <div style="padding-left: 74px;white-space: normal;  word-break: break-all;display: flex;flex-wrap: wrap;">
                <div v-for="v in item.children" style="font-size: 14px;padding-right: 10px;display: flex;flex-wrap: wrap;color: #6d6a6a">
                    <span>
                        <input type="checkbox" >  {{  v.label }}
                     </span>
                </div>
              </div>
            </slot>
          </div>
        </a-form-item>

    </a-form>

  </a-modal>


</template>

<script>
  import { httpAction, getAction,putAction } from '@api/manage'

export default {
    name: 'DoctorGoobModal',
    inject: ['reload'],
    props: {
      modalMisible: {
        default: false
      }
    },
    data() {
      return {
        title: '擅长选择',
        modalMisible: false,
        beGoodAt: [
          {
            value: ' ',
            label: ' ',
            children: [
              {
                value: ' ',
                label: ' ',
              },
            ],
          },
        ],
        form: this.$form.createForm(this),
        url: {
          list: "/doctor/doctor/configEdit",

          goodInfo:"/doctor/doctor/goodInfo",
        },
      }
    },
    created() {
      this.showDoctor();
    },
    computed: {
      show: {
        get: function () {
          return this.modalMisible
        },
        set: function () {
        }
      }
    },
    methods: {
      showDoctor(record) {
        let attr = {};
        attr.id = record.id;

        getAction(this.url.goodInfo, attr).then(res => {

          this.beGoodAt = res.result;
          // return this.beGoodAt;
        })

        this.modalMisible = true
      },

      submitOk () {
        // putAction(this.url.list, this.forms).then((res)=>{
        //
        //   if(res){
        //     this.$message.success(res.message)
        //     this.reload()
        //   }else{
        //     this.$message.warning(res.message)
        //
        //   }
        //
        // }).catch((error)=>{
        //   console.log(error);
        // })
      },




    }
  }
</script>

<style lang="less" scoped></style>